﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.oa.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.oa.dao.*;
import com.hh.bss.oa.entity.*;
import com.hh.bss.oa.service.*;
import com.hh.bss.oa.vo.query.*;
import com.hh.bss.util.*;





public class OaNewsAttachment extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "OaNewsAttachment";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_NEWS_ID = "newsId";
	public static final String ALIAS_ATTACHMENT_NAME = "attachmentName";
	public static final String ALIAS_ATTACHMENT_FILE = "attachmentFile";
	public static final String ALIAS_ATTACHMENT_FILESIZE = "attachmentFilesize";
	public static final String ALIAS_ATTACHMENT_FILETYPE = "attachmentFiletype";
	public static final String ALIAS_UPLOAD_DT = "uploadDt";
	
	//date formats
	public static final String FORMAT_UPLOAD_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer newsId;
	@NotBlank @Length(max=255)
	private java.lang.String attachmentName;
	@NotBlank @Length(max=255)
	private java.lang.String attachmentFile;
	@NotNull 
	private java.lang.Integer attachmentFilesize;
	@Length(max=10)
	private java.lang.String attachmentFiletype;
	
	private java.util.Date uploadDt;
	//columns END

	public OaNewsAttachment(){
	}

	public OaNewsAttachment(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setNewsId(java.lang.Integer value) {
		this.newsId = value;
	}
	
	public java.lang.Integer getNewsId() {
		return this.newsId;
	}
	public void setAttachmentName(java.lang.String value) {
		this.attachmentName = value;
	}
	
	public java.lang.String getAttachmentName() {
		return this.attachmentName;
	}
	public void setAttachmentFile(java.lang.String value) {
		this.attachmentFile = value;
	}
	
	public java.lang.String getAttachmentFile() {
		return this.attachmentFile;
	}
	public void setAttachmentFilesize(java.lang.Integer value) {
		this.attachmentFilesize = value;
	}
	
	public java.lang.Integer getAttachmentFilesize() {
		return this.attachmentFilesize;
	}
	public void setAttachmentFiletype(java.lang.String value) {
		this.attachmentFiletype = value;
	}
	
	public java.lang.String getAttachmentFiletype() {
		return this.attachmentFiletype;
	}
	public String getUploadDtString() {
		return DateConvertUtils.format(getUploadDt(), FORMAT_UPLOAD_DT);
	}
	public void setUploadDtString(String value) {
		setUploadDt(DateConvertUtils.parse(value, FORMAT_UPLOAD_DT,java.util.Date.class));
	}
	
	public void setUploadDt(java.util.Date value) {
		this.uploadDt = value;
	}
	
	public java.util.Date getUploadDt() {
		return this.uploadDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("NewsId",getNewsId())
			.append("AttachmentName",getAttachmentName())
			.append("AttachmentFile",getAttachmentFile())
			.append("AttachmentFilesize",getAttachmentFilesize())
			.append("AttachmentFiletype",getAttachmentFiletype())
			.append("UploadDt",getUploadDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof OaNewsAttachment == false) return false;
		if(this == obj) return true;
		OaNewsAttachment other = (OaNewsAttachment)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

